/**
 * com.monte.persistence.command.UpdateEntityCommand.java
 * create by FengMy from 2013
 */
package com.monte.persistence.command;

import com.monte.persistence.CommandContext;
import com.monte.persistence.PersistenceCommand;

/**
 * @描述:更新实体命令(JPA)
 * @author FengMy
 * @since 2013-3-4
 */
public class UpdateEntityCommand<T> implements PersistenceCommand {
	public T entity;
	
	public UpdateEntityCommand(T entity){
		this.entity = entity;
	}
	
	@Override
	public Object execute(CommandContext context) {
		context.getEntityManager().merge(entity);
		return entity;
	}

}
